package unamur.iodass.registration;

import java.util.ArrayList;

import org.apache.log4j.Logger;

import unamur.iodass.communication.messages.BookStore;
import unamur.iodass.communication.messages.ParcelDelivery;

public class ParcelDeliveryHandler {

	private static final Logger logger = Logger.getLogger(ParcelDeliveryHandler.class);

	
	private static volatile ParcelDeliveryHandler instance;
	private ArrayList<ParcelDelivery> deliveries;
	
	
	public static ParcelDeliveryHandler getInstance() {
		if (instance == null) {
			synchronized (ParcelDeliveryHandler.class) {
				if (instance == null) {
					instance = new ParcelDeliveryHandler();
				}
			}
		}
		return instance;
	}
	
	private ParcelDeliveryHandler() {
		deliveries = new ArrayList<ParcelDelivery>();
	}

	public void addDelivery(ParcelDelivery parceldelivery) {
		deliveries.add(parceldelivery);
	}
	
	public ArrayList<ParcelDelivery> getDeliveries() {
		return deliveries;
	}
	
}
